clear
svmat e(b), names(col)
xpose, clear varname
gen i = _n
tempfile B
save `B', replace

clear
svmat e(cband), names(col)
gen i = _n
merge 1:1 i using `B', nogen
count if b != v1
drop i v1

keep if inlist(_varname,"Tm5","Tm4","Tm3","Tm2") | inlist(_varname,"Tp0","Tp1","Tp2","Tp3","Tp4","Tp5") | inlist(_varname,"Tp6","Tp7","Tp8","Tp9","Tp10")

set obs 16
replace _varname = "Tm1" if mi(_varname)
replace b = 0 if mi(b)

gen rel_time = .
forvalues i = 1/5 {
replace rel_time = -`i' if _varname == "Tm`i'"
}
forvalues i = 0/10 {
replace rel_time = `i' if _varname == "Tp`i'"
}

sort rel_time
drop _varname
